//
//  TearchReplyModel.m
//  ChatDemo-UI2.0
//
//  Created by syun on 16/8/16.
//  Copyright © 2016年 syun. All rights reserved.
//

#import "TearchReplyModel.h"

@implementation TearchReplyModel

-(float)cellHeight{
    
    return [self resizeContenLabelHeightWithSting:self.scontent] + 42;
}

- (CGFloat)resizeContenLabelHeightWithSting:(NSString *)text
{
    if (text.length == 0) {
        return 0;
    }
    UIFont *font = [UIFont systemFontOfSize:13];
    
    NSStringDrawingOptions opts = NSStringDrawingUsesLineFragmentOrigin;
    
    //NSMutableParagraphStyle *style = [[NSMutableParagraphStyle alloc] init];
    //[style setLineBreakMode:NSLineBreakByCharWrapping];
    
    NSDictionary *attributes = @{ NSFontAttributeName : font};
    
    CGSize maxSize = CGSizeMake(SCREENWIDTH-24-10-38, 6000);
    CGSize size = [text boundingRectWithSize:maxSize
                                     options:opts
                                  attributes:attributes
                                     context:nil].size;
    return size.height ;
    
}

@end
